package com.example.listmoudle.sliper

import androidx.recyclerview.widget.ItemTouchHelper
import com.alibaba.android.arouter.facade.annotation.Route
import com.android.baselibrary.base.BaseActivity
import com.example.listmoudle.R
import com.example.listmoudle.arouter.RecyclerPath
import com.example.listmoudle.databinding.ActivityListSliperBinding

/**
 * @author: Mr.You
 * @create: 2022-12-15 13:54
 * @description: 探探效果
 **/
@Route(path = RecyclerPath.RECYCLE_SLIPER_LIST)
class SliperListActivity:BaseActivity<ActivityListSliperBinding>() {
    private var list :MutableList<String> = mutableListOf<String>()
    override fun getLayoutId(): Int {
        return R.layout.activity_list_sliper
    }

    override fun initView() {
       val linearLayoutManager = SliperLayoutManager()
        mBinding.recycleView.layoutManager = linearLayoutManager
        val adapter = SliperAdapter()
        mBinding.recycleView.adapter = adapter



        list.add("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fhbimg.huabanimg.com%2F8aa52c046a235e059e0504b2e3edf21a70592b7718a2f-t7YRGW_fw658&refer=http%3A%2F%2Fhbimg.huabanimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1673676745&t=6e5805e6a0655a28ac9efb9c67d3ccc7")
        list.add("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fblog%2F202111%2F17%2F20211117092914_579a7.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1673676745&t=427ce14e84dff22bc43793d385eb4f14")
        list.add("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.win4000.com%2Fmobile%2F2019-09-17%2F5d808aff75776.jpg&refer=http%3A%2F%2Fpic1.win4000.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1673676745&t=cf5f037830f27c050b5da591f3422b26")
        list.add("https://img1.baidu.com/it/u=3645175713,3742200614&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=727")
        list.add("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.win4000.com%2Fmobile%2F2020-09-03%2F5f50634238266.jpg&refer=http%3A%2F%2Fpic1.win4000.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1673676745&t=0dc006a328f67bbad52d96e122b4c125")
        list.add("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fblog%2F202109%2F06%2F20210906225922_1c31b.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1673676745&t=4965d86d7158ff11906610f25c379854")
        list.add("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fhbimg.huabanimg.com%2F8aa52c046a235e059e0504b2e3edf21a70592b7718a2f-t7YRGW_fw658&refer=http%3A%2F%2Fhbimg.huabanimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1673676745&t=6e5805e6a0655a28ac9efb9c67d3ccc7")
        list.add("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fblog%2F202111%2F17%2F20211117092914_579a7.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1673676745&t=427ce14e84dff22bc43793d385eb4f14")
        list.add("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.win4000.com%2Fmobile%2F2019-09-17%2F5d808aff75776.jpg&refer=http%3A%2F%2Fpic1.win4000.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1673676745&t=cf5f037830f27c050b5da591f3422b26")
        list.add("https://img1.baidu.com/it/u=3645175713,3742200614&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=727")
        list.add("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.win4000.com%2Fmobile%2F2020-09-03%2F5f50634238266.jpg&refer=http%3A%2F%2Fpic1.win4000.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1673676745&t=0dc006a328f67bbad52d96e122b4c125")
        list.add("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fblog%2F202109%2F06%2F20210906225922_1c31b.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1673676745&t=4965d86d7158ff11906610f25c379854")


        val touchHelper = SliperItemTouchHelperCallBack(adapter,list)

        val itemTouchHelper = ItemTouchHelper(touchHelper)
        itemTouchHelper.attachToRecyclerView(mBinding.recycleView)
        adapter.setData(list)
    }

    override fun initListener() {

    }
}